#include "MineDesign3D/DrawFPS.hpp"
#include "Util/FPSCounter.hpp"
#include "GLHelper/ScopedAttribPush.hpp"
#include <Windows.h>
#include <GL/GL.h>
#include <GL/freeglut.h>
namespace{
Util::FPSCounter fpsCounter;
}
namespace MineDesign3D{
void DrawFPS()
{
	fpsCounter.update();

	GLHelper::ScopedAttribPush Att(GL_CURRENT_BIT);

	glColor3f(1.f,1.f,1.f);
	glRasterPos2i(0,18);
	static char Buffer[32];
	sprintf_s<sizeof(Buffer)>(Buffer,"FPS:%d",static_cast<int>(fpsCounter.getFPS()));

	glutBitmapString(GLUT_BITMAP_HELVETICA_18,reinterpret_cast<unsigned char*>(Buffer));
}
}//MineDesign3D